package com.itheima.itheima_03;

public class AAA implements Runnable {
    @Override
    public void run() {
        while(true){
            //同步代码块
            synchronized ("左筷子"){
                System.out.println("蔡金成拿起了左筷子");

                //同步代码块
                synchronized ("右筷子"){
                    System.out.println("蔡金成拿起了右筷子");

                    System.out.println("金成拿起了大吃一口！！！");
                }
            }
        }
    }
}
